package bb.lanxing.lib.devices.bici.model;

import java.io.Serializable;
import java.nio.ByteBuffer;

public class BiciFile implements Serializable {
    public static final int TYPE_BODY = 76;
    public static final int TYPE_HEADER = 72;
    private int filename;
    private int index;
    private int packageCount;
    private int size;
    private int type;

    public BiciFile() {
    }

    public BiciFile(byte[] bArr) {
        ByteBuffer wrap = ByteBuffer.wrap(bArr);
        this.index = wrap.getShort();
        this.type = wrap.get();
        this.size = wrap.getInt();
        this.packageCount = wrap.getShort();
        this.filename = wrap.getInt();
    }

    public String toString() {
        return "index = " + this.index + ", type = " + this.type + ", size = " + this.size + ", packageCount = " + this.packageCount + ", filename = " + this.filename;
    }

    public boolean equals(Object obj) {
        if (obj instanceof BiciFile) {
            return ((BiciFile) obj).getFilename() == this.filename;
        }
        return super.equals(obj);
    }

    public int getIndex() {
        return this.index;
    }

    public void setIndex(int i) {
        this.index = i;
    }

    public int getType() {
        return this.type;
    }

    public void setType(int i) {
        this.type = i;
    }

    public int getSize() {
        return this.size;
    }

    public void setSize(int i) {
        this.size = i;
    }

    public int getPackageCount() {
        return this.packageCount;
    }

    public void setPackageCount(int i) {
        this.packageCount = i;
    }

    public int getFilename() {
        return this.filename;
    }

    public void setFilename(int i) {
        this.filename = i;
    }
}
